package com.future.direction.ui.activity;

import android.content.pm.ActivityInfo;

import com.bumptech.glide.Glide;
import com.future.direction.R;
import com.future.direction.di.component.AppComponent;
import com.future.direction.ui.widget.MyJzvdStd;

import butterknife.BindView;
import cn.jzvd.Jzvd;
import cn.jzvd.JzvdStd;

public class CoursePlayerActivity extends BaseActivity {


    @BindView(R.id.mJC)
    MyJzvdStd myJzvdStd;

    @Override
    public int setLayout() {
        return R.layout.activity_course_player;
    }

    @Override
    public void getExtras() {

    }

    @Override
    public boolean init() {
        initView();
        return false;
    }

    private void initView() {
        myJzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"
                , "饺子快长大",JzvdStd.SCREEN_NORMAL);
        Glide.with(this).load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png").into(myJzvdStd.thumbImageView);

    }

    @Override
    public void setListener() {

    }

    @Override
    public void setupAcitivtyComponent(AppComponent appComponent) {

    }

//    @Override
//    protected void onResume() {
//        super.onResume();
//        Jzvd.FULLSCREEN_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
//        Jzvd.NORMAL_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
//    }

    @Override
    protected void onPause() {
        super.onPause();
        Jzvd.releaseAllVideos();
    }

    @Override
    public void onBackPressed() {
        if (Jzvd.backPress()) {
            return;
        }
        super.onBackPressed();
    }

}
